<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02-变量</title>
</head>
<body>
<script>
    var name = "jack" // 定义变量, var: variable
    console.log(name)
    name = "tom"  //修改变量
    console.log(name)
    console.log(typeof name)  //typeof: 打印变量类型
    // delete name //删除变量
    // console.log(name) // name is not defined
    var sex
    console.log(typeof sex) //undefined
</script>
<script>
    var username = "rose"
    var age = 18
    var money = 100.1
    var is_man = false
<!--    var home = object-->
    console.log(username, typeof username) //rose string
    console.log(age,typeof age) //18 'number'
    console.log(money, typeof money)  //100.1 'number'
    console.log(is_man, typeof is_man)  // false 'boolean'
<!--    console.log(home, typeof home)  // null 'object'-->

    var result = 5 / "张三"
    console.log(result, typeof result)  //NaN 'number'
    var res = 5 / 0
    console.log(res, typeof res)  //Infinity 'number'
</script>
</body>
</html>